package com.wondertek.poms.service.controller;

import com.wondertek.poms.common.vo.ResultBean;
import com.wondertek.poms.core.service.IFirstProductInfoPackageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenjijiang
 * @description 一级产品controller
 */
@Api(value = "FirstProductInfoPackageController", description = "一级产品 接口")
@Slf4j
@RestController
@Scope("prototype")
@RequestMapping(value = "/pc-product-first")
public class FirstProductInfoPackageController {

	@Autowired
	private IFirstProductInfoPackageService firstProductInfoPackageService;

	/**
	 *
	 * @return 一级产品 全量列表
	 */
	@ApiOperation(value = "一级产品 全量列表", notes = "所有一级产品")
	@GetMapping("/list/all")
	public ResultBean listAll() {
		return ResultBean.ok(firstProductInfoPackageService.findAll());
	}

	/**
	 *
	 * @return 一级产品 除全量列表
	 */
	@ApiOperation(value = "产品展现 一级产品列表查询", notes = "产品展现 一级产品列表查询")
	@GetMapping("/list-for-prd-info")
	public ResultBean listForPrdInfo() {
		return ResultBean.ok(firstProductInfoPackageService.findAll());
	}

	/**
	 *
	 * @return 一级产品 查询列表
	 */
	@ApiOperation(value = "一级产品条件查询列表", notes = "一级产品条件查询列表")
	@GetMapping("/list/by-id-name")
	public ResultBean listAllByParam() {
		return ResultBean.ok(firstProductInfoPackageService.findAll());
	}
}
